import http from '@/base/api/public'
import querystring from 'querystring'
let sysConfig = require('@/../config/sysConfig')
let apiUrl = sysConfig.xcApiUrlPre;

// 定义方法，请求服务端的页面查询接口
export const page_list = (page,size,params)=>{
  // 拼接params
  let qStr = querystring.stringify(params);
  // 请求服务端的页面查询接口
  return http.requestQuickGet(apiUrl+"/cms/page/list/"+page+"/"+size+"?"+qStr)
}

//新增cms
export const page_add = (pageForm)=>{

  // 请求服务端的页面查询接口
  return http.requestPost(apiUrl+"/cms/page/add",pageForm);
}

//页面id查询页面
export const page_get = (pageId) => {
  return http.requestQuickGet(apiUrl+"/cms/page/get/"+pageId);
}
// 编辑页面
export const page_edit = (pageId,cmsPage) => {
  return http.requestPut(apiUrl+"/cms/page/edit/"+pageId,cmsPage);
}

// 删除
export const page_del = (pageId) => {
  return http.requestPut(apiUrl+"/cms/page/get/"+pageId);
}


// 发布页面
export const page_postPage = (pageId) =>{
  return http.requestPost(apiUrl+"/cms/page/postPage/"+pageId);
}
